package com.xunge.controller;

import com.xunge.mapper.OperateLogMapper;
import com.xunge.pojo.OperateLog;
import com.xunge.pojo.PageResult;
import com.xunge.pojo.Result;
import com.xunge.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LogController {

    @Autowired
    private OperateLogService operateLogService;
    @GetMapping("/log/page")
    public Result list(@RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "10") Integer pageSize) {

        PageResult<OperateLog> pageResult = operateLogService.list(page,pageSize);
        log.info("日志信息: {}", pageResult);
        return Result.success(pageResult);
    }
}
